#include <stdio.h>

/*
 * 识别带多个计数器的for loop
 */

int main()
{
	int a, b;

	for (a = 1, b = 10; a < 10, b > 1; a++, b--)
		printf("%x %x\n", a, b);

	return 0;
}

#if 0

/*
 * intel
 */
0000000000001149 <main>:
    1149:	f3 0f 1e fa          	endbr64 
    114d:	55                   	push   %rbp
    114e:	48 89 e5             	mov    %rsp,%rbp
    1151:	48 83 ec 10          	sub    $0x10,%rsp
    1155:	c7 45 f8 01 00 00 00 	movl   $0x1,-0x8(%rbp)	// (rbp-0x8)=0x1
    115c:	c7 45 fc 0a 00 00 00 	movl   $0xa,-0x4(%rbp)	// (rbp-0x4)=0xa
    1163:	eb 21                	jmp    1186 <main+0x3d>	// jump
    1165:	8b 55 fc             	mov    -0x4(%rbp),%edx	// edx=(rbp-0x4)
    1168:	8b 45 f8             	mov    -0x8(%rbp),%eax	// eax=(rbp-0x8)
    116b:	89 c6                	mov    %eax,%esi	// esi=eax
    116d:	48 8d 3d 90 0e 00 00 	lea    0xe90(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>
    1174:	b8 00 00 00 00       	mov    $0x0,%eax	// eax=0
    1179:	e8 d2 fe ff ff       	callq  1050 <printf@plt>
    117e:	83 45 f8 01          	addl   $0x1,-0x8(%rbp)	// (rbp-0x8)+=0x1
    1182:	83 6d fc 01          	subl   $0x1,-0x4(%rbp)	// (rbp-0x4)-=0x1
    1186:	83 7d fc 01          	cmpl   $0x1,-0x4(%rbp)	// (rbp-0x4)-0x1
    118a:	7f d9                	jg     1165 <main+0x1c>
    118c:	b8 00 00 00 00       	mov    $0x0,%eax
    1191:	c9                   	leaveq 
    1192:	c3                   	retq   
    1193:	66 2e 0f 1f 84 00 00 	nopw   %cs:0x0(%rax,%rax,1)
    119a:	00 00 00 
    119d:	0f 1f 00             	nopl   (%rax)

/*
 * arm
 */
000000000040055c <main>:
  40055c:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  400560:	910003fd 	mov	x29, sp
  400564:	52800020 	mov	w0, #0x1                   	// #1
  400568:	b9001fa0 	str	w0, [x29, #28]		// [x29+28]=0x1
  40056c:	52800140 	mov	w0, #0xa                   	// #10
  400570:	b9001ba0 	str	w0, [x29, #24]		// [x29+24]=0xa
  400574:	1400000c 	b	4005a4 <main+0x48>
  400578:	90000000 	adrp	x0, 400000 <_init-0x3e8>
  40057c:	9119c000 	add	x0, x0, #0x670
  400580:	b9401ba2 	ldr	w2, [x29, #24]	// w2=0xa
  400584:	b9401fa1 	ldr	w1, [x29, #28]	// w1=0x1
  400588:	97ffffb2 	bl	400450 <printf@plt>
  40058c:	b9401fa0 	ldr	w0, [x29, #28]	// w0=0x1
  400590:	11000400 	add	w0, w0, #0x1	// w0=w0+0x1
  400594:	b9001fa0 	str	w0, [x29, #28]	// [x29+28]=w0
  400598:	b9401ba0 	ldr	w0, [x29, #24]	// w0=[x29+24]
  40059c:	51000400 	sub	w0, w0, #0x1	// w0=w0-0x1
  4005a0:	b9001ba0 	str	w0, [x29, #24]	// [x29+24]=w0
  4005a4:	b9401ba0 	ldr	w0, [x29, #24]	// w0=[x29+24]
  4005a8:	7100041f 	cmp	w0, #0x1
  4005ac:	54fffe6c 	b.gt	400578 <main+0x1c>
  4005b0:	52800000 	mov	w0, #0x0                   	// #0
  4005b4:	a8c27bfd 	ldp	x29, x30, [sp], #32
  4005b8:	d65f03c0 	ret
  4005bc:	00000000 	.inst	0x00000000 ; undefined

#endif
